{include file="header.html"}
<script type="text/javascript"> 
		function login() {
			var ret_url = $("#ret_url").attr("value");
			var user_name = $("#user_name").val();
			var password = $("#password").val();
			var ca=$("#captcha1").val();
			var captchaEnable = <!--{if $captcha}-->true<!--{else}-->false<!--{/if}-->;
			if(captchaEnable == false)
			{
				errormsg("{$lang.open_captcha_pls}");
			}
			else
			{
				if(user_name==""){
					errormsg("{$lang.user_name_required}");
					return false;
				}else{
					if(password==""){
						errormsg("{$lang.password_required}");
						return false;
					}else{
						if(ca==""){
							 errormsg("{$lang.captcha_required}");
							 return false;
						 }else{
								var ca_url =REAL_SITE_URL+"/index.php?app=captcha&act=check_captcha";
								$.getJSON(ca_url,{captcha:ca},function(data){
									if(data==false){
										errormsg("{$lang.captcha_error}");
										return false;
									}else{ 
										 var url = REAL_SITE_URL+"/index.php?app=member&act=login";
											$.post(url,{user_name:user_name, password:password},function(data){
												if(data == false){
													 errormsg("{$lang.login_name_or_password_not_right}"); 
													 return false;
												}else{
													msg("{$lang.login_successed}");
													setTimeout(function(){
														window.location.href=ret_url?unescape(ret_url):REAL_SITE_URL+"/index.php";
													},1500);
												}  
										},"json");
									}
								});
						 }
					}
				}
			}
		}
	</script>
<div id="main" class="pb20">
	<div id="page-auth" class="page-login">
        <dl class="form pb20">
				<dd><input type="text" id="user_name" name="user_name" class="input" placeholder=" {$lang.input_user_name}" /></dd>
				<dd><input type="password" name="password" id="password" class="input" placeholder=" {$lang.input_password}" /></dd>
				<!--{if $captcha}-->
				<dd class="captcha-box">
                    <input type="text" name="captcha" class="input captcha" id="captcha1" placeholder=" {$lang.input_captcha}" />
                    <img id="captcha" src="{$site_url}/mobile/index.php?app=captcha&amp;{$random_number}" onclick="javascript:change_captcha($('#captcha'));"  /><br />
                </dd>
                <!--{/if}-->
				<input type="button"  onclick="login();" class="enter yahei" value="{$lang.login}" />                                  
                <input type="hidden" name="ret_url" id="ret_url" value="{$ret_url}" />
                <p class="mt20">{$lang.not_member} <a href="{url app=member&act=register&ret_url=$ret_url}" title="{$lang.register}">{$lang.register}</a></p>

        </dl>
       
        <div class="pb20 ml10 partner">
        	<a href="{$site_url}/mobile/index.php?app=qqconnect&act=login"><img src="{$site_url}/mobile/static/images/qq.png" /></a>
        	<a href="{$site_url}/mobile/index.php?app=alipayconnect&act=login"><img src="{$site_url}/mobile/static/images/alipay.png" /></a>
            <a href="{$site_url}/mobile/index.php?app=xwbconnect&act=login"><img src="{$site_url}/mobile/static/images/weibo.png" /></a>
            
        </div>
	</div>
</div>
{include file="footer.html"}